public class Exercise {
    public static int result(int a){
        int i=1;
        while (a/10>0)
        {
            a=a/10;
            i++;
        }
        return i;
    }
  public static int digitionCount(int a,int c){
        int x=a;
        int b=result(x);
      int number=0;
      for ( int i=b-1;i>=b-c;i--) {
          number=a/(int)Math.pow(10,i);
          a=a%(int)Math.pow(10, i);

      }
      return  number;
  }
}